package com.ruijie.quartz;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@EnableScheduling
public class ScheduledTask {

	private static final SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
	public static Random random =new Random();

	@Scheduled(fixedRate = 5000)
	public void reportCurrentTime() {
		System.out.println("current time is：" + dateFormat.format(new Date()));
	}
	
}
